<?php

class room extends thingy {
    
function allrooms() {
    global $db;

    // Create bogus object, for convenience
    $r = new room();
    $table = $r->table;

    $ret = array();
    $q = $db->safe_query( 'SELECT ID FROM %s ORDER BY name ', $table );
    $rows = $db->get_results( $q );
    if ( $rows ) {
        foreach ( $rows as $row ) {
            $ret[] = new room( array ( 'ID' => $row->ID ));
        }
    } else {
        $ret = array();
    }
    return $ret;
}
    
}

?>
